/*
 * @(#)NToast.java $version 2012. 11. 8.
 *
 * Copyright 2007 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

package com.kelly.wager;

import android.content.Context;
import android.widget.Toast;

/**
 * @author kelly
 */
public class NToast {
	public static void showToast(Toast toast, Context ctx, int messageId, boolean isShort) {
		showToast(toast, ctx, ctx.getString(messageId), isShort);
	}

	public static void showToast(Toast toast, Context ctx, String message, boolean isShort) {
		if (toast == null) {
			toast = Toast.makeText(ctx, message, isShort ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG);
		} else {
			toast.setText(message);
			toast.setDuration(isShort ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG);
		}

		toast.show();
	}
}
